import request from '@/utils/request'

// 查询质量问题列表
export function listPhysicalDefect(query) {
  return request({
    url: '/quality/physicalDefect/list',
    method: 'get',
    params: query
  })
}

// 查询半年质量问题列表
export function getRecentHalfYearDefect(query) {
  return request({
    url: '/quality/physicalDefect/getRecentHalfYearDefect',
    method: 'get',
    params: query
  })
}

// 查询质量问题详细
export function getPhysicalDefect(defectId) {
  return request({
    url: '/quality/physicalDefect/' + defectId,
    method: 'get'
  })
}

// 新增质量问题
export function addPhysicalDefect(data) {
  return request({
    url: '/quality/physicalDefect',
    method: 'post',
    data: data
  })
}

// 修改质量问题
export function updatePhysicalDefect(data) {
  return request({
    url: '/quality/physicalDefect',
    method: 'put',
    data: data
  })
}

// 删除质量问题
export function delPhysicalDefect(defectId) {
  return request({
    url: '/quality/physicalDefect/' + defectId,
    method: 'delete'
  })
}
